package com.xinke.service.Impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinke.entity.EtcGantryTrafficData;
import com.xinke.mapper.target.EtcGantryTrafficDataMapper;
import com.xinke.service.EtcGantryTrafficDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;

/**
 * @author 86987
 * @description 针对表【etc_gantry_traffic_data(ETC门架交调站5分钟收费车型数据表)】的数据库操作Service实现
 * @createDate 2025-09-01 10:21:46
 */
@Service
public class EtcGantryTrafficDataServiceImpl extends ServiceImpl<EtcGantryTrafficDataMapper, EtcGantryTrafficData>
        implements EtcGantryTrafficDataService {

    @Autowired
    private EtcGantryTrafficDataMapper etcGantryTrafficDataMapper;


    @Override
    public void updateUploadByIds(List<Long> ids, Integer status) {
        etcGantryTrafficDataMapper.updateStatus(ids, status, null, null, null);

    }

    @Override
    public void updateUploadByIds(List<Long> ids, Integer status, String message, LocalDateTime localDateTime) {
        etcGantryTrafficDataMapper.updateStatus(ids, status, message, localDateTime, null);
    }

    @Override
    public void updateUploadByIds(List<Long> ids, Integer status, String message) {
        etcGantryTrafficDataMapper.updateStatus(ids, status, message, null, null);
    }

    /**
     * 带版本号
     *
     * @param ids
     * @param status
     * @param message
     * @param versionIncrement
     */
    @Override
    public void updateUploadByIds(List<Long> ids, Integer status, String message, Integer versionIncrement) {
        etcGantryTrafficDataMapper.updateStatus(ids, status, message, null, versionIncrement);
    }

    /**
     * 查询最早数据和最新数据
     *
     * @param latestCount
     * @return
     */
    @Override
    public List<EtcGantryTrafficData> getUnUploadOrFailUploadDateLatestAndNewest(Integer latestCount) {
        return etcGantryTrafficDataMapper.selectUnUploadOrFailUploadDateLatestAndNewest(latestCount);
    }
}




